package factory_method

import "fmt"

// 打印机接口
type Printer interface {
	Print()
}

type CnPrinter struct {
}

func (r *CnPrinter) Print() {
	fmt.Println("CnPrinter execute......")
}

type EnPrinter struct {
}

func (r *EnPrinter) Print() {
	fmt.Println("EnPrinter execute......")
}

// 打印机创建者接口
type PrinterCreator interface {
	Create() Printer
}

type CnPrinterCreator struct {
}

func (r CnPrinterCreator) Create() Printer {
	return new(CnPrinter)
}

type EnPrinterCreator struct {
}

func (r EnPrinterCreator) Create() Printer {
	return new(EnPrinter)
}
